<?php
/**
 * Dependency Events listener
 *
 * PHP version 5
 *
 * @category  W
 * @package   Services
 * @author    Olivier Hoareau <olivier@phppro.fr>
 * @copyright 2009 PHPPRO http://www.phppro.fr
 * @license   http://dev.phppro.fr/license PHPPRO
 * @version   SVN: $Id:$
 * @link      http://dev.phppro.fr/projects/wdependency
 */
require_once 'W/Dependency/Listener/Abstract.php';
/**
 * Dependency Events listener
 *
 * @category  W
 * @package   Services
 * @author    Olivier Hoareau <olivier@phppro.fr>
 * @copyright 2009 PHPPRO http://www.phppro.fr
 * @license   http://dev.phppro.fr/license PHPPRO
 * @version   SVN: $Id$
 * @link      http://dev.phppro.fr/projects/wdependency
 */
class W_Dependency_Listener_Events extends W_Dependency_Listener_Abstract
{
    /**
     * List all expected events
     *
     * @return W_Dependency_Listener_Interface
     */
    public function listExpectedEvents()
    {
        return array('all');
    }

    /**
     * Processes the specified event
     *
     * @param string $type the event type to process
     * @param array  $data the optional data of the event
     *
     * @return array list of optional additional files to analyze
     *
     * @throws RuntimeException if an error occured
     */
    public function processEvent($type,$data=null)
    {
        $files = parent::processEvent($type,$data);

        W_W::log()->log("Event #$type: ".json_encode($data),'debug',__CLASS__);
        return $files;
    }
}